const Request = require("./Request");
const {
  requestToken,
  requestOrigin,
} = require("../../configs/sellingMembershipConfig");
const request = new Request({
  timeout: 1000 * 60,
  interceptors: {
    request: (config) => {
      config.headers["Access-Token-User"] = requestToken;

      (config.headers["Origin"] = requestOrigin),
        (config.headers["Referer"] = requestOrigin);
      return config;
    },
    // responseCatch: (error) => {
    //   // 无效的token
    //   if (error?.code === '20000') {
    //     // userStore.logout(true);
    //   }
    //   return Promise.reject(error);
    // },
  },
});

module.exports = {
  request,
};
